Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

deRenderStates_priv.hpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 /// @file deRenderStates_priv.hpp
00003 ///
00004 /// @brief private renderstate implementations
00005 ///
00006 /// @author Lightning
00007 ///
00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
00009 /// contents of this file is subject to the Destiny3D Member License which
00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
00011 ///
00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
00014 /// for any particular purpose.
00015 ///
00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
00017 ///
00018 /// <hr>
00019 ///                                 Change History
00020 /// <hr>
00021 ///
00022 /// @date May 2002
00023 /// @author Lightning
00024 /// @remarks Creation
00025 ///
00026 ///////////////////////////////////////////////////////////////////////////////
00027 
00028 #ifndef DERENDERSTATES_PRIV_HPP
00029 #define DERENDERSTATES_PRIV_HPP
00030 
00031 #include "deRenderStates.hpp"
00032 #include "deFile.hpp"
00033 #include "deWorld_Helper.hpp"
00034 
00035 class deRenderState : public deWorldObject, virtual public IdeRenderState
00036 {
00037 protected:
00038     deRenderState();
00039     virtual ~deRenderState();
00040     deBoolean   Lock();
00041     deBoolean   Unlock();
00042     void*       GetWOInterface(long interface_id);
00043     long        m_LockFlag;     //flag if it is locked
00044 };
00045 
00046 //the texture renderstate class
00047 class deRenderTexture : public deRenderState, public IdeRenderTexture
00048 {
00049     //constructor/destructor
00050 protected:
00051     ~deRenderTexture();
00052 public:
00053     deRenderTexture();
00054 
00055 #if defined(DESTINY3D_STATIC_LINK)
00056     friend deBoolean IdeRenderState_SetDefaultTextureFilters(long MinFilter, long MagFilter, long MipFilter, deBoolean EnableMip);  
00057 #else
00058     friend __declspec(dllexport) deBoolean IdeRenderState_SetDefaultTextureFilters(long MinFilter, long MagFilter, long MipFilter, deBoolean EnableMip);    
00059 #endif
00060     IdeRenderState::Type GetRSType() const;
00061     void *      GetRSInterface(IdeRenderState::Type type) const;
00062     WorldObjectClassDef;
00063     deBoolean DeSerializeLoad();
00064     
00065     //functions for setting/returning texture operations
00066     deBoolean SetColorOperation(long Stage, TextureOp ColorOp);
00067     deBoolean SetAlphaOperation(long Stage, TextureOp AlphaOp);
00068     TextureOp GetColorOperation(long Stage) const;
00069     TextureOp GetAlphaOperation(long Stage) const;
00070     deBoolean SetResultTarget(long Stage, TextureArg Target);
00071     TextureArg GetResultTarget(long Stage);
00072     
00073     //functions for setting the arguments
00074     deBoolean SetColorArg(long Stage, long ArgNum, TextureArg Arg);
00075     deBoolean SetAlphaArg(long Stage, long ArgNum, TextureArg Arg);
00076     TextureArg GetColorArg(long Stage, long ArgNum) const;
00077     TextureArg GetAlphaArg(long Stage, long ArgNum) const;
00078 
00079     //texture information
00080     deBoolean SetBitmap(long Stage, IdeBitmapProxy* Bitmap);
00081     IdeBitmapProxy*GetBitmap(long Stage) const;
00082 
00083     //functions to set how the texture looks
00084     deBoolean SetTextureAddressU(long Stage, TextureAddress Address);
00085     deBoolean SetTextureAddressV(long Stage, TextureAddress Address);
00086     TextureAddress GetTextureAddressU(long Stage) const;
00087     TextureAddress GetTextureAddressV(long Stage) const;
00088 
00089     // functions to set how the texture magnifies and minifies
00090     // ie, linear filter to magnify is very common
00091     deBoolean SetTextureMinFilter(long Stage, TextureFilter Filter);
00092     deBoolean SetTextureMagFilter(long Stage, TextureFilter Filter);
00093     deBoolean SetTextureMipFilter(long Stage, TextureFilter Filter);
00094     TextureFilter GetTextureMinFilter(long Stage) const;
00095     TextureFilter GetTextureMagFilter(long Stage) const;
00096     TextureFilter GetTextureMipFilter(long Stage) const;
00097     
00098     deBoolean SetTexCoordSource(long Stage, long SourceStage);
00099     deBoolean SetTexCoordGen(long Stage, TextureCoordSource SourcePipe, long CopyWrapModeStage);
00100     deBoolean GetTexCoordSource(long Stage, long &SourceStage, TextureCoordSource &SourceFlags);
00101     long GetTexCoordSourceCombined(long Stage);
00102     
00103     deBoolean SetTextureProjection(long Stage, deBoolean Enable);
00104     deBoolean GetTextureProjection(long Stage);
00105     
00106     deBoolean CopyStageSettings(IdeRenderTexture* Target, long SourceStage, long TargetStage) const;
00107 
00108 private:
00109     deBoolean       m_EnableMipMaps;
00110     deBoolean       m_TextureProjection[TEXTURESTAGE_COUNT];
00111     TextureArg      m_ColorArgs[TEXTURESTAGE_COUNT][4];     //color arguments and result target
00112     TextureArg      m_AlphaArgs[TEXTURESTAGE_COUNT][3];     //alpha arguments
00113     TextureOp       m_ColorOperation[TEXTURESTAGE_COUNT];   //color operation
00114     TextureOp       m_AlphaOperation[TEXTURESTAGE_COUNT];   //alpha operation
00115     IdeBitmapProxy* m_Bitmaps[TEXTURESTAGE_COUNT];          //texture bitmap class
00116     TextureAddress  m_TextureAddressU[TEXTURESTAGE_COUNT];  //the texture address U
00117     TextureAddress  m_TextureAddressV[TEXTURESTAGE_COUNT];  //the texture address V
00118     TextureFilter   m_TextureFilterMin[TEXTURESTAGE_COUNT]; //texture minification filter
00119     TextureFilter   m_TextureFilterMag[TEXTURESTAGE_COUNT]; //texture magnification filter
00120     TextureFilter   m_TextureFilterMip[TEXTURESTAGE_COUNT]; //texture magnification filter
00121     long            m_TexCoordSource[TEXTURESTAGE_COUNT];
00122     deIDPair        m_CachedBitmapIDs[TEXTURESTAGE_COUNT];
00123 
00124     static TextureFilter DefaultMinFilter, DefaultMagFilter, DefaultMipFilter;
00125     static deBoolean DefaultToMip;
00126 };
00127 
00128 //the material renderstate class
00129 class deRenderMaterial : public deRenderState, public IdeRenderMaterial
00130 {
00131     //constructor/destructor
00132 protected:
00133     ~deRenderMaterial();
00134 public:
00135     deRenderMaterial();
00136 
00137     IdeRenderState::Type GetRSType() const;
00138     void *      GetRSInterface(IdeRenderState::Type type) const;
00139     WorldObjectClassDef;
00140     
00141     //color information
00142     deBoolean SetAmbientColor(deColor *AmbientColor);
00143     deBoolean GetAmbientColor(deColor *AmbientColor) const;
00144     
00145     deBoolean SetDiffuseColor(deColor *DiffuseColor);
00146     deBoolean GetDiffuseColor(deColor *DiffuseColor) const;
00147     
00148     deBoolean SetSpecularColor(deColor *SpecularColor);
00149     deBoolean GetSpecularColor(deColor *SpecularColor) const;
00150     
00151     deBoolean SetEmissiveColor(deColor *EmissiveColor);
00152     deBoolean GetEmissiveColor(deColor *EmissiveColor) const;
00153 
00154     // base source info
00155     deBoolean SetAmbientSource(MatSource_t Source);
00156     MatSource_t GetAmbientSource() const;
00157 
00158     deBoolean SetDiffuseSource(MatSource_t Source);
00159     MatSource_t GetDiffuseSource() const;
00160 
00161     deBoolean SetSpecularSource(MatSource_t Source);
00162     MatSource_t GetSpecularSource() const;
00163 
00164     deBoolean SetEmissiveSource(MatSource_t Source);
00165     MatSource_t GetEmissiveSource() const;
00166     
00167     //power of the light
00168     deBoolean SetSpecularPower(float Power);
00169     float GetSpecularPower() const;
00170     
00171     const MatData* GetAllData() const;
00172     deBoolean SetAllData(const MatData* Data);
00173 
00174 private:
00175     MatData m_Data;
00176 };
00177 
00178 //the light renderstate class
00179 class deRenderLight : public deRenderState, public IdeRenderLight
00180 {
00181     //constructor/destructor
00182 protected:
00183     ~deRenderLight();
00184 public:
00185     deRenderLight();
00186 
00187     IdeRenderState::Type GetRSType() const;
00188     void *      GetRSInterface(IdeRenderState::Type type) const;
00189     WorldObjectClassDef;
00190     
00191     //the light type
00192     deBoolean SetLightType(LightType_t Type);
00193     LightType_t GetLightType() const;
00194 
00195     //color information
00196     deBoolean SetAmbientColor(deColor *AmbientColor);
00197     deBoolean GetAmbientColor(deColor *AmbientColor) const;
00198 
00199     deBoolean SetDiffuseColor(deColor *DiffuseColor);
00200     deBoolean GetDiffuseColor(deColor *DiffuseColor) const;
00201 
00202     deBoolean SetSpecularColor(deColor *SpecularColor);
00203     deBoolean GetSpecularColor(deColor *SpecularColor) const;
00204 
00205     //position/direction information
00206     deBoolean SetPosition(deVertex *Position);
00207     deBoolean GetPosition(deVertex *Position) const;
00208 
00209     deBoolean SetDirection(deVertex *Direction);
00210     deBoolean GetDirection(deVertex *Direction) const;
00211 
00212     //anything that affects the way the light looks/acts
00213     deBoolean SetRange(float MaxRange);
00214     float GetRange() const;
00215 
00216     deBoolean SetFallOff(float FallOff);
00217     float GetFallOff() const;
00218 
00219     deBoolean SetAttenuation(long Number, float Value);
00220     float GetAttenuation(long Number) const;
00221 
00222     deBoolean SetTheta(float Theta);
00223     float GetTheta() const;
00224 
00225     deBoolean SetPhi(float Phi);
00226     float GetPhi() const;
00227 
00228     //which light number it is
00229     deBoolean SetID(long Number);
00230     long GetID() const;
00231 
00232     //light status (on/off)
00233     deBoolean SetStatus(deBoolean On);
00234     deBoolean GetStatus() const;
00235 
00236     const LightData* GetAllData() const;
00237     deBoolean SetAllData(const LightData* Data);
00238 
00239 private:
00240     LightData   m_Data;
00241 };
00242 
00243 #endif

Generated on Mon Sep 12 19:58:36 2005 for Destiny3D by doxygen1.3-rc3